package com.base.thread.demo_01;

/**
 * 实现runnable接口
 * @ClassName: Demo2
 * @Description: 
 * @Author xuyou
 * @DateTime 2019年12月7日 下午2:23:48
 */
public class Demo2 implements Runnable {

	private Integer num;
	
	public Integer getNum() {
		return num;
	}

	public void setNum(Integer num) {
		this.num = num;
	}
	
	

	public Demo2() {
		super();
	}

	public Demo2(Integer num) {
		super();
		this.num = num;
	}

	@Override
	public void run() {
		while(true) {
			System.out.println(num);
//			System.out.println("thread running ...");
		}
	}

	public static void main(String[] args) {
		Thread thread = new Thread(new Demo2(2));
		thread.start();
	}
	
}
